#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :demo.py
# @Time      :2021/7/27 12:00
# @author    :Harry
from selenium import webdriver   # 引入webdriver
import time

driver = webdriver.Chrome()       # 实例化driver对象
driver.maximize_window()  # 窗口最大化
time.sleep(2)
driver.minimize_window()  # 窗口最小化

url = 'http://www.baidu.com'
driver.get(url)  # 访问百度首页
time.sleep(1)
driver.maximize_window()  # 窗口最大化

driver.get('http://www.jd.com')
driver.set_window_size(600,800)
driver.back()       # 后退
driver.forward()    # 前进
driver.refresh()    # 刷新

time.sleep(2)     # 强制等待
driver.get('http://www.taobao.com')




time.sleep(3)
# driver.close()    # 关闭当前窗口
driver.quit()   # 关闭所有窗口及后台进程
